package com.demo.service;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.demo.mapper.DetailMapper;
import com.demo.pojo.Detail;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @BelongsProject: demo1
 * @BelongsPackage: com.demo.service
 * @Author: fwx
 * @CreateTime: 2023-03-01  14:16
 * @Description: TODO
 * @Version: 1.0
 */
@Service
public class DetailService {

    @Resource
    private DetailMapper detailMapper;

    /**
     * @description: 查看金额明细数据
     * @author: fwx
     * @date: 2023/3/1 16:03
     * @param: [accountNumber:账户号]
     * @return: void
     **/
    public void getBalanceDetail(String accountNumber){
        LambdaQueryWrapper<Detail> wrapper=new LambdaQueryWrapper<Detail>().eq(Detail::getAccountNumber,accountNumber);
        List<Detail> details = detailMapper.selectList(wrapper);

        System.out.println(accountNumber+"账户的金额变动明细数据为"+details);
    }
}
